unit OC_Fact;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Provider, SqlExpr, DB, DBClient, DBLocal, DBLocalS, Grids,
  DBGrids, RXDBCtrl, StdCtrls, DBCtrls;

type
  TfrmOC_Fact = class(TForm)
    RxDBGrid1: TRxDBGrid;
    RxDBGrid2: TRxDBGrid;
    cdsFactura: TSQLClientDataSet;
    cdsFacturaMATERIAL: TStringField;
    cdsFacturaCANTIDAD: TFloatField;
    sFactura: TDataSource;
    cdsOC: TSQLClientDataSet;
    sOC: TDataSource;
    cdsOCCANTIDAD: TFloatField;
    cdsOCMATERIAL: TStringField;
    cdsFacturaNUMERO: TIntegerField;
    cdsFacturaRAZON: TStringField;
    Label1: TLabel;
    Label2: TLabel;
    cdsOCRAZON: TStringField;
    DBText1: TDBText;
    DBText2: TDBText;
    cdsOCFECHA: TDateField;
    cdsFacturaFECHA: TSQLTimeStampField;
  private
    Fusuario: word;
    procedure Setusuario(const Value: word);
    { Private declarations }
  published
    property usuario: word read Fusuario write Setusuario;
  public
    constructor CreateNuevo(AOwner: TComponent; usuario: word; numOC: integer);
  end;

var
  frmOC_Fact: TfrmOC_Fact;

implementation

uses MDatos;

{$R *.dfm}

{ TForm1 }

constructor TfrmOC_Fact.CreateNuevo(AOwner: TComponent; usuario: word;
  numOC: integer);
begin
  inherited Create(Aowner);
  self.usuario := usuario;
  self.cdsOC.Params [0].AsInteger := numOC;
  self.cdsOC.Open;
  self.cdsFactura.Params [0].AsInteger := numOC;
  self.cdsFactura.Open;
  self.ShowModal;
end;

procedure TfrmOC_Fact.Setusuario(const Value: word);
begin
  Fusuario := Value;
end;

end.
